﻿using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Log4NetSql
{
    public class LogHelper
    {
        public static string LoggerName = "webLogger";

        private static ILog log = LogManager.GetLogger(LoggerName);

        public static void LogInfo(AppOpLog opLog)
        {
            if (log.IsInfoEnabled)
            {
                log.Info(opLog);
            }
        }

        public static void LogError(AppOpLog opLog, Exception ex)
        {
            if (log.IsErrorEnabled)
            {
                log.Error(opLog, ex);
            }
        }

        public static void LogFatal(AppOpLog opLog, Exception ex)
        {
            if (log.IsFatalEnabled)
            {
                log.Fatal(opLog, ex);
            }
        }

        public static void LogWarn(AppOpLog opLog, Exception ex)
        {
            if (log.IsWarnEnabled)
            {
                log.Warn(opLog, ex);
            }
        }
    }
}
